Dynomotion

Group: DynoMotion Message: 9333 From: Hugh Sontag Date: 3/18/2014
Subject: SnapAmp I/O bit rate
Hi Tom,

When the SnapAmp I/O bits are used, are there any restrictions on reading and writing those bits?

In my case, I'm using I/O bits 0 - 8, and some are inputs and some are outputs.

When SetBit() or ClearBit() is called, is it sufficient to expect that the state of the bits is transferred to/from KFLOP after one call to WaitNextTimeSlice() ? 

Does it happen faster than that?

I'm using some of these bits for an interface to a serial EEPROM.

Thanks,
Hugh

Group: DynoMotion Message: 9334 From: Tom Kerekes Date: 3/18/2014
Subject: Re: SnapAmp I/O bit rate
Hi Hugh,

It should happen faster than that.  I suspect the call to SetBit or ClearBit should take 1~2us and the bit out of SnapAmp should be changed by the time the call returns. 

The SetBit Function ultimately does:
WriteSnapAmp(SNAP0+SNAP_SET_BIT,1<<(bit-N_BITS-N_VIRTUAL_BITS-16));

Which calls this.  WriteSnapAmpNoDelay writes the data quickly to KFLOP's FPGA then delays 90 DSP cycles (0.45us) for KFLOP's FPGA to transmit the data to SnapAmp's FPGA.  If you are careful to avoid a new write (or read) to SnapAmp too quickly you can optimize it a bit more.


void WriteSnapAmp(int add, int data)
{
WriteSnapAmpNoDelay(add,data);  // this is non-interruptable
asm("  NOP 9");
asm("  NOP 9");
asm("  NOP 9");
asm("  NOP 9");
asm("  NOP 9");
asm("  NOP 9");
asm("  NOP 9");
asm("  NOP 9");
asm("  NOP 9");
asm("  NOP 9");
}

Regards
TK

Group: DynoMotion Message: 9335 From: Hugh Sontag Date: 3/18/2014
Subject: Re: SnapAmp I/O bit rate
Thanks, Tom. I wasn't aware that KFLOP copied the changed state to the SnapAmp that quickly.

Hugh


On Tue, Mar 18, 2014 at 12:12 PM, Tom Kerekes <tk@...> wrote:
 

Hi Hugh,

It should happen faster than that.  I suspect the call to SetBit or ClearBit should take 1~2us and the bit out of SnapAmp should be changed by the time the call returns. 

The SetBit Function ultimately does:
WriteSnapAmp(SNAP0+SNAP_SET_BIT,1<<(bit-N_BITS-N_VIRTUAL_BITS-16));

Which calls this.  WriteSnapAmpNoDelay writes the data quickly to KFLOP's FPGA then delays 90 DSP cycles (0.45us) for KFLOP's FPGA to transmit the data to SnapAmp's FPGA.  If you are careful to avoid a new write (or read) to SnapAmp too quickly you can optimize it a bit more.


void WriteSnapAmp(int add, int data)
{
WriteSnapAmpNoDelay(add,data);  // this is non-interruptable
asm("  NOP 9");
asm("  NOP 9");
asm("  NOP 9");
asm("  NOP 9");
asm("  NOP 9");
asm("  NOP 9");
asm("  NOP 9");
asm("  NOP 9");
asm("  NOP 9");
asm("  NOP 9");
}

Regards
TK